Of the many flags that can be specified in the first field, the following are most frequently used:
b or c | Block (b) or character (c) device. One or the other is essential for any device driver. |
f or m | STREAMS driver (f) or module (m). |
n or p | Multiprocessor-aware (n) or uniprocessor-only (p) driver. This flag must correspond to the presence or absence of D_MP in the pfxdevflag global. |
s | Software driver, either a pseudo-device or a SCSI driver. |
The s (software-only) flag tells lboot not to attempt to probe for hardware. This is the case with software-only (pseudo-device) drivers, and with SCSI drivers. If lboot tries to probe for a SCSI device, it fails, and assumes that the device is not present, and does not include your SCSI device driver.
Additional flags (d, R, N, D) for loadable drivers are discussed later under "Configuring a Loadable Driver".
In most cases, an OEM driver does not have any dependencies. However, a SCSI driver (see Chapter 15, "SCSI Device Drivers") should list the name scsi, since it depends on the inner SCSI driver. A STREAMS driver might list the name of a STREAMS support module such as clone (see "Support for CLONE Drivers").
It is possible for you to design a driver in the form of multiple, loadable modules. In that case, you would name your support modules in this field.
Since a device or STREAMS driver provides only standard entry points that are accessed via the switch tables rather than by linking, drivers do not need to define any stubs.
The advantage of defining global variables in the master file is that the initializing expressions for these variables can include the major device number and the number of supported sub-devices, as specified in the descriptive line of the file. This is how you make these items available to your driver without coding them into the driver. In the source code of the driver you can write
extern major_t myMajNum; extern int myDevLimit;In the master file you can write
$$$ major_t myMajNum = ##E; int myDevLimit = ##C;The global myDevLimit is compiled with the number of devices from the descriptive line. The global myMajNum is compiled with the major number. (In a loadable driver this technique requires one additional step; see "Master File for Loadable Drivers".)